!!!###!!!title=39-How to customize the length of the pie chart guide line——VisActor/VChart FAQ documents!!!###!!!

How to customize the length of the pie chart guide line?

Question Description

When a general pie chart displays labels, an additional guide line is usually drawn to connect the sectors and the corresponding labels (similar to https://echarts.apache.org/examples/zh/editor.html?c=pie-simple). However, the common guideline logic in several chart libraries does not support configuration. What should I do if I need to customize the length of this guide line?

Solution

VChart provides a built-in layout algorithm for pie chart labels, and allows developers to customize some key configuration items in layout calculations. Developers can set the minimum length of the two leading lines through the label.line.line1MinLength and label.line.line2MinLength configuration items of the pie chart label.

For the details of the VChart pie chart label layout algorithm, please refer to this article: https://zhuanlan.zhihu.com/p/179166155

Code Example

Quote